home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vol15n11.zip / TBWIZ.ZIP / MENUITEM.CLS < prev    next >
Text File  |  1996-02-24  |  1KB  |  50 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "tbMenuItem"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public VBInstance As Object
  11. Public Operation As Integer
  12.  
  13. Public Sub AfterClick()
  14. '___process menu line click events
  15. Dim i%, j%
  16. Dim MyProperty As Object
  17. Dim testControl As Object
  18. '___make sure form doesn't have unsaved changes
  19. If Not CheckForDirt() Then
  20.     Select Case Operation
  21.     Case opLoad
  22.         Load tbLoadForm
  23.     Case opSave
  24.         Load tbSaveForm
  25.     End Select
  26. End If
  27. End Sub
  28.  
  29. Public Function CheckForDirt() As Boolean
  30. '___warn user if form need to be saved
  31. Dim CurrFormName$, i%
  32. With gobjIDEAppInst.ActiveProject
  33.     CurrFormName$ = .ActiveForm.Properties.Item("Name")
  34.     With .Components
  35.         For i% = 0 To .Count - 1
  36.             If .Item(i%).Name = CurrFormName$ Then
  37.                 If .Item(i%).IsDirty Then
  38.                                     
  39.                     CheckForDirt = True
  40.                     Beep
  41.                     Load SavePrmpt
  42.                   Exit Function
  43.                 End If
  44.             End If
  45.         Next
  46.     End With
  47. End With
  48. End Function
  49.  
  50.